/*****************************************************
*
*               COPYRIGHT (c) 2015-2017 Hargic Corporation
*                         All Rights Reserved
*
* The source code contained or described herein and all documents
* related to the source code ("Material") are owned by Hargic
* Corporation or its licensors.  Title to the Material remains
* with Hargic Corporation or its suppliers and licensors.
*
* The Material is protected by worldwide copyright and trade secret
* laws and treaty provisions. No part of the Material may be used,
* copied, reproduced, modified, published, uploaded, posted, transmitted,
* distributed, or disclosed in any way except in accordance with the
* applicable license agreement.
*
* No license under any patent, copyright, trade secret or other
* intellectual property right is granted to or conferred upon you by
* disclosure or delivery of the Materials, either expressly, by
* implication, inducement, estoppel, except in accordance with the
* applicable license agreement.
*
* Unless otherwise agreed by Hargic in writing, you may not remove or
* alter this notice or any other notice embedded in Materials by Hargic
* or Hargic's suppliers or licensors in any way.
*
** Author: ted.huang
** Date: 2018-02-25
*
*****************************************************/

#ifndef __SPI_IF_H_
#define __SPI_IF_H_

#ifdef __cplusplus
extern "C"{
#endif

/***** INCLUDES *************************************/

/***** TYPEDEFS *************************************/

/***** DEFINES **************************************/

/***** CONSTANTS ************************************/

/***** VARIABLES ************************************/

/***** EXTERNAL VARIABLES ***************************/

/***** EXTERNAL FUNCTIONS ***************************/

/***** PROTOTYPES ***********************************/
int spi_init(int order, int mode, int divider);
int spi_deinit(void);
uint8_t spi_transfer(uint8_t value);
void spi_transfern(char *buf, uint32_t len);
void spi_transfernb(char *tbuf, char *rbuf, uint32_t len);


#ifdef __cplusplus
}
#endif

#endif /* __SPI_IF_H_ */

